Skip to content

fix mysqldump option #449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2019
Merged

Conversation

WiFeng
Copy link
Contributor

@WiFeng WiFeng commented Nov 13, 2019

mysqldump client version 8.0 / MacOS
mysql server version 5.7

mysqldump --host=10.100.130.8 --port=3306 --user=liujilei --password=liujilei --master-data --single-transaction --skip-lock-tables --compact --skip-opt --quick --no-create-info --skip-extended-insert --skip-tz-utc --hex-blob --default-character-set=utf8  lingxi_user_account_rds profile_0 profile_1

error:

mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'lingxi_user_account_rds' AND TABLE_NAME = 'profile_0';': Unknown table 'column_statistics' in information_schema (1109)

Becuase column-statistics default value is TRUE, I add a extra option which can be set as needed.

eg.

    cfg := NewDefaultConfig()
    cfg.Addr = "10.100.130.1:3306"
    cfg.User = "root"
    cfg.Password = ""
    cfg.Dump.TableDB = "users"
    cfg.Dump.Tables = []string{"profile_0", "profile_1"}
    
    // It's here !!!!!!!
    cfg.Dump.ExtraOptions = []string{"--column-statistics=false"}

    c, err := NewCanal(cfg)
    if err != nil {
        log.Printf("%s", err)
    }
    // Register a handler to handle RowsEvent
    c.SetEventHandler(&MyEventHandler{})

    // Start canal
    c.Run()

@siddontang siddontang merged commit 07ca784 into go-mysql-org:master Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants